<?php 
include_once ('../global.php');
$show = $_GET['show'];
$roundtext=array(
	1=>'第一轮',
	2 =>'第二轮',
	3 =>'决赛轮',
	4 =>'',
);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<link href="<?php echo CSS_PATH?>main.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<?php echo JS_PATH?>jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="<?php echo JS_PATH?>echarts.js"></script>
<script type="text/javascript" src="<?php echo JS_PATH?>main.js"></script>
<title>球洞统计-<?php echo $match_cn_name?>-Scoring By 斯科云科技</title>
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js "></script>
 
<script>
    var  url=location.href;
	var wxdata;
		//alert(url.split("&")[0]);
		//console.log(url.replace(/\&/g,"%26").replace(/\#/g,"%23"));
    $.ajax({
        type : "get",
        url : "http://live.scoringchina.com/scoringchina/wx/weixin_token/jssdk.php?url="+ url.replace(/\&/g,"%26").replace(/\#/g,"%23"),
        dataType : "jsonp",
        jsonp: "callback",
        jsonpCallback:"success_jsonpCallback",
        success : function(data){
			//console.log(data);
			wxdata = data;
            wx.config({
                debug: false,
                appId: data.appId,
                timestamp: data.timestamp,
                nonceStr: data.nonceStr,
                signature: data.signature,
                jsApiList: [
                    'onMenuShareTimeline',//
                    'onMenuShareAppMessage',
                    'onMenuShareQQ',
                    'onMenuShareWeibo',
                    'onMenuShareQZone'
 
                ]
            });
			//console.log(wxdata);
        },
        error:function(data){
           // alert("连接失败！");
        }
    });
 
    wx.ready(function () {
         var shareData = {
            title:'<?php echo $match_cn_name?>-球洞统计-Scoring By 斯科云科技',//'内部链接', //
            desc: '<?php echo $match_cn_name?>-球洞统计-Scoring By 斯科云科技',//'By 斯科云科技 ScoringChina',//
            link: url,
            imgUrl: 'http://live.scoringchina.com/scoringchina/yngamaopen/2022/mobile/images/logo.png'
        };
		//alert(wxdata.url);
		//alert(url);
        wx.onMenuShareAppMessage(shareData);//分享给好友
        wx.onMenuShareTimeline(shareData);//分享到朋友圈
        wx.onMenuShareQQ(shareData);//分享给手机QQ
        wx.onMenuShareWeibo(shareData);//分享腾讯微博
        wx.onMenuShareQZone(shareData);//分享到QQ空间
 
 
 
    });
    wx.error(function (res) {
		//console.log(res);
        // alert(res.errMsg);//错误提示
 
    });

	
	
	var pullrefresh = {
	init : function() {
		var pos = {};
		var status = false;
		var divobj = null;
		var contentobj = null;
		var reloadflag = false;
		$('body').on('touchstart', function(e) {
			//console.log(pos);
			e = mygetnativeevent(e);
			pos.startx = e.touches[0].pageX;
			pos.starty = e.touches[0].pageY;
			
		})
		.on('touchmove', function(e) {
			e = mygetnativeevent(e);
			////console.log(pos);
			pos.curposx = e.touches[0].pageX;
			pos.curposy = e.touches[0].pageY;
			if(pos.curposy - pos.starty < 0 && !status) {
				return;
			}
			if(!status && $(window).scrollTop() <= 0) {
			
				status = true;
				divobj = document.createElement('div');
				divobj = $(divobj);
				divobj.css({'position':'relative', 'margin-left':'-85px'});
				$('body').prepend(divobj);
				contentobj = document.createElement('div');
				contentobj = $(contentobj);
				contentobj.css({'position':'absolute', 'height':'30px', 'top': '-30px', 'left':'50%'});
				contentobj.html('<img src="./images/icon_arrow.gif" style="vertical-align:middle;margin-right:5px;-moz-transform:rotate(180deg);-webkit-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg);"><span id="refreshtxt">下拉可以刷新</span>');
				contentobj.find('img').css({'-webkit-transition':'all 0.5s ease-in-out'});
				divobj.prepend(contentobj);
				pos.topx = pos.curposx;
				pos.topy = pos.curposy;
			}
			if(!status) {
				return;
			}
			if(status == true) {
				var pullheight = pos.curposy - pos.topy;
				if(pullheight >= 0 && pullheight < 100) {
					divobj.css({'height': pullheight/2 + 'px'});
					contentobj.css({'top': (-30 + pullheight/2 + 60) + 'px'});
					if(reloadflag) {
						contentobj.find('img').css({'-webkit-transform':'rotate(180deg)', '-moz-transform':'rotate(180deg)', '-o-transform':'rotate(180deg)', 'transform':'rotate(180deg)'});
						contentobj.find('#refreshtxt').html('下拉可以刷新');
					}
					reloadflag = false;
				} else if(pullheight >= 100) {
					divobj.css({'height':pullheight/2 + 'px'});
					contentobj.css({'top': (-30 + pullheight/2 + 60 ) + 'px'});
					if(!reloadflag) {
						contentobj.find('img').css({'-webkit-transform':'rotate(360deg)', '-moz-transform':'rotate(360deg)', '-o-transform':'rotate(360deg)', 'transform':'rotate(360deg)'});
						contentobj.find('#refreshtxt').html('松开可以刷新');
					}
					reloadflag = true;
				}
			}
			e.preventDefault();
		})
		.on('touchend', function(e) {
			if(status == true) {
				if(reloadflag) {
					contentobj.html('<img src="./images/icon_load.gif" style="vertical-align:middle;margin-right:5px;">正在加载...');
					contentobj.animate({'top': (-30 + 75 + 60) + 'px'}, 618, 'linear');
					divobj.animate({'height': '75px'}, 618, 'linear', function() {
						//window.location = './index.php?mt_id='+mt_id + '&rd_id='+rd_id;
						
						getdata(rd_id,true,divobj,contentobj,status,function(){
							if(divobj){
								divobj.remove();
							}
							divobj = null;
							status = false;
							pos = {};
						});
						
						
					});
					
					return;
				}
			}
			if(divobj){
				divobj.remove();
			}
			divobj = null;
			status = false;
			pos = {};
		});
	}
};
function mygetnativeevent(event) {
	while(event && typeof event.originalEvent !== "undefined") {
		event = event.originalEvent;
	}
	return event;
};
$(document).ready(function() {
	////console.log($('.pullrefresh').length)
	if($('.pullrefresh').length > 0) {
		pullrefresh.init();
	}
});

var mt_id = <?php echo $mt_id; ?>;
var rd_id = <?php echo $rd_id; ?>;
var mt_sts = '<?php echo $mt_sts; ?>';
var mt_round = <?php echo $mt_round; ?>;


var time=60*5; //自动刷新五分钟
getdata(rd_id,true);
 




 var interval=setInterval(function(){
			if(mt_sts == 'O'){
				time=60*5;
				getdata(rd_id,false);			
			}
			else if(mt_sts == 'N'){
				time = 60* 30; //半小时刷新一次
				getdata(rd_id,false);
			}
			else{
				clearInterval(interval);
			}
    },time*1000);

	
  
	
	function getdata(rd,isloading,divobj,contentobj,status,func){
			if(isloading){
			   //$('#loadingimg').show();
			}
		   // //console.log(rd);
			$.ajax({
                    url:'./data/holestatistics-data.php?time='+Date.now()+'&mt_id='+mt_id+'&rd_id='+rd_id,
                    dataType:"json",
                    success:function(res){
                       
                     
                        jsonscoredata = res;
						//console.log(res);
						
					    
						changeholestatiscroundranktype("",true);
						////console.log(page);
                    },
					complete:function(){
						if(func){
							func();
						}
						//pullrefresh.init();
						
						
						if(isloading){
							//$('#loadingimg').hide();
						}
					}
                })
		}
		


function fillholstatic(data){
	if(!data)
	{
		data = jsonscoredata;
	}
	console.log(data);
	var html = '';
	var index = 0;
	if(data.holestatisc && data.holestatisc.length>0){
	for(var i in data.holestatisc){
		var holestatisc = data.holestatisc[i];
		html += '<div onclick="openholestatisc('+ holestatisc.sc_ho_id +','+i+')" class="float_between conranking form white '+ (index%2 ==1 ? 'rows':'') +'" >';
        html +=  ' <div class="red32 poppin piccenter w10">'  +  holestatisc.pos + '</div>';
        html +=  '  <div class="black28l poppin piccenter w10">'+holestatisc.sc_ho_id+'</div>';
        html +=  '   <div class="black28l poppin piccenter w10 parb">'+holestatisc.sc_par+'</div>';
        html +='<div class="black28l poppin piccenter w20"><text class="'+(holestatisc.diff>0?'up':(holestatisc.diff<0?'down':''))+'">'+(holestatisc.diff==='0.00' || holestatisc.diff===0?'':(holestatisc.diff>0?'▲':'▼'))+'</text>'+holestatisc.agv+'</div>';
        html +=  '    <div class="black28l poppin piccenter w10">';
        html += holestatisc.total?'<div class="holestatiscitems eagle" style="width:'+holestatisc.eagles/holestatisc.total *100 + '%'+'"></div>':'';
        html +=  '      <text>'+holestatisc.eagles+'</text>';
        html +=  '    </div>';
        html +=  '    <div class="black28l poppin piccenter w10">';
        html +=  holestatisc.total?'      <div class="holestatiscitems birdie" style="width:'+holestatisc.birdie/holestatisc.total  *100 + '%'+'"></div>':'';
        html +=  '      <text>'+holestatisc.birdie+'</text>';
        html +=  '    </div>';
        html +=  '    <div class="black28l poppin piccenter w10">';
        html +=  holestatisc.total?'      <div class="holestatiscitems par" style="width:'+holestatisc.par/holestatisc.total  *100 + '%'+'"></div>':'';
         html +=  '     <text>'+holestatisc.par+'</text>';
        html +=  '    </div>';
        html +=  '    <div class="black28l poppin piccenter w10">';
        html +=  holestatisc.total?'      <div class="holestatiscitems boegey" style="width:'+holestatisc.bogey/holestatisc.total  *100 + '%'+'"></div>':'';
        html +=  '      <text>'+holestatisc.bogey+'</text>';
        html +=  '    </div>';
        html +=  '    <div class="black28l poppin piccenter w10">';
        html +=  holestatisc.total?'      <div class="holestatiscitems dboegey" style="width:'+holestatisc.dbogey/holestatisc.total *100  + '%'+'"></div>':'';
        html +=  '      <text>'+holestatisc.dbogey+'</text>';
        html +=  '    </div>';
        html +=  '    <div class="black28l poppin piccenter w10">';
        html +=  holestatisc.total?'      <div class="holestatiscitems worts" style="width:'+holestatisc.worst/holestatisc.total  *100 + '%'+'"></div>':'';
        html +=  '     <text>'+holestatisc.worst+'</text>';
        html +=  '    </div>';
        html +=  '  </div>';
		index++;
	}
	
	html+= ' <div class="float_between conranking form white bottom" wx:if="'+data.holestatisc_totals+'">';
    html+= '        <div class="red32 poppin piccenter w16">合计</div>';
    html+= '        <div class="black28l poppin piccenter w10 parb">'+data.holestatisc_totals.sc_par+'</div>';
    html+= '        <div class="black28l poppin piccenter w20"><text class="'+(data.holestatisc_totals.diff>0?'up':(data.holestatisc_totals.diff<0?'down':''))+'">'+(data.holestatisc_totals.diff==='0.00' || data.holestatisc_totals.diff===0?'':(data.holestatisc_totals.diff>0?'▲':'▼'))+'</text>'+data.holestatisc_totals.agv+'</div>';
    html+= '        <div class="black28l poppin piccenter w10">';
    html+= '          <div class="holestatiscitems eagle" style="width:'+data.holestatisc_totals.eagles/data.holestatisc_totals.total *100 + '%'+'"></div>';
    html+= '          <text>'+data.holestatisc_totals.eagles+'</text>';
    html+= '        </div>';
    html+= '        <div class="black28l poppin piccenter w10">';
    html+= '          <div class="holestatiscitems birdie" style="width:'+data.holestatisc_totals.birdie/data.holestatisc_totals.total  *100 + '%'+'"></div>';
    html+= '          <text>'+data.holestatisc_totals.birdie+'</text>';
     html+= '       </div>';
    html+= '        <div class="black28l poppin piccenter w10">';
    html+= '          <div class="holestatiscitems par" style="width:'+data.holestatisc_totals.par/data.holestatisc_totals.total  *100 + '%'+'"></div>';
    html+= '          <text>'+data.holestatisc_totals.par+'</text>';
    html+= '        </div>';
    html+= '        <div class="black28l poppin piccenter w10">';
    html+= '          <div class="holestatiscitems boegey" style="width:'+data.holestatisc_totals.bogey/data.holestatisc_totals.total  *100 + '%'+'"></div>';
    html+= '          <text>'+data.holestatisc_totals.bogey+'</text>';
    html+= '        </div>';
     html+= '       <div class="black28l poppin piccenter w10">';
    html+= '          <div class="holestatiscitems dboegey" style="width:'+data.holestatisc_totals.dbogey/data.holestatisc_totals.total *100  + '%'+'"></div>';
    html+= '          <text>'+data.holestatisc_totals.dbogey+'</text>';
    html+= '        </div>';
    html+= '        <div class="black28l poppin piccenter w10">';
    html+= '          <div class="holestatiscitems worts" style="width:'+data.holestatisc_totals.worst/data.holestatisc_totals.total  *100 + '%'+'"></div>';
    html+= '          <text>'+data.holestatisc_totals.worst+'</text>';
    html+= '        </div>';
    html+= '      </div>'
	

	}
	else{
		html+= '<div class="empty"><text class="pangmen">暂无球洞统计</text></div>';
	}
	
	$('#divholestatisc').html(html);
	
	
}

var currentdisplayholeid = '';
function nexthole(){
	
	if(!currentdisplayholeid){
		return ;
	}
	var holestatisc = jsonscoredata.holestatisc;
		if(!holestatisc){
			return;
		}
	
	if(currentdisplayholeid == 18){
		currentdisplayholeid = 1;
	}
	else{
		currentdisplayholeid++;
	}
		openholestatisc(currentdisplayholeid,'');
	
}

function prevhole(){
		
	if(!currentdisplayholeid){
		return ;
	}
	var holestatisc = jsonscoredata.holestatisc;
		if(!holestatisc){
			return;
		}
		if(currentdisplayholeid == 1){
		currentdisplayholeid = 18;
	}
	else{
		currentdisplayholeid--;
	}
	openholestatisc(currentdisplayholeid,'');
}

function openholestatisc(sc_ho_id,index){
		if(!jsonscoredata.holestatisc || jsonscoredata.holestatisc.length<=0){
				return ;
		}
		
		if(index === ''){
			
			jsonscoredata.holestatisc.forEach((item, i)=>{
				if(item.sc_ho_id == sc_ho_id){
					index = i;
				}
			});
			if(index === '') {
			return ;
			}
		}
		var holestatisc = jsonscoredata.holestatisc[index];
		if(!holestatisc){
			return;
		}
		
		currentdisplayholeid = sc_ho_id;
		$('#infotitle').html('<div style="margin-bottom:6px;background-color:#1067ac;color:#fff;border-radius:4px; padding-left:10px;padding-right:10px; display:flex;align-items:center; width:100% ;justify-content:space-between;"><div>' + sc_ho_id+ '号洞' + '</div><div style="text-align:right;color:#fff;font-weight:700;flex:1">R' + rd_id +'</div></div>'); 
		 var str = '<div style="width:fit-content;">' +
                    '<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f; margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#db0011"></span></div> <div style="padding:0 16px 0 6px;width:auto">排名:</div> <div style="text-align:right;color:rgb(102,102,102);font-weight:700;flex:1">' + holestatisc.pos +'</div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f; margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#db0011"></span></div> <div style="padding:0 16px 0 6px;width:auto">PAR:</div> <div style="text-align:right;color:rgb(102,102,102);font-weight:700;flex:1">' + holestatisc.sc_par +'</div></div>' +
				
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#db0011"></span></div> <div style="padding:0 16px 0 6px;width:auto">杆数:</div> <div style="text-align:right;color:rgb(102,102,102);font-weight:700;flex:1">' + holestatisc.agv  +' </div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#cfcfcf"></span></div> <div style="padding:0 16px 0 6px;width:auto">难度:</div> <div style="text-align:right;color:'+ (holestatisc.diff<0? '#DF212F':'#333333'  )+';font-weight:700;flex:1">' + holestatisc.diff +' </div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#FFCC00"></span></div> <div style="padding:0 16px 0 6px;width:auto">老鹰:</div> <div style="text-align:right;color:#FFCC00;font-weight:700;flex:1">' + holestatisc.eagles +'</div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#DF212F"></span></div> <div style="padding:0 16px 0 6px;width:auto">小鸟:</div> <div style="text-align:right;color:#DF212F;font-weight:700;flex:1">' +  holestatisc.birdie +' </div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#53565A"></span></div> <div style="padding:0 16px 0 6px;width:auto">帕:</div> <div style="text-align:right;color:#53565A;font-weight:700;flex:1">' + 
					holestatisc.par +'</div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#1E90FF"></span></div> <div style="padding:0 16px 0 6px;width:auto">博忌:</div> <div style="text-align:right;color:#1E90FF;font-weight:700;flex:1">' + holestatisc.bogey+'</div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#473D98"></span></div> <div style="padding:0 16px 0 6px;width:auto">双博忌:</div> <div style="text-align:right;color:#473D98;font-weight:700;flex:1">' + holestatisc.dbogey +'</div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#333333"></span></div> <div style="padding:0 16px 0 6px;width:auto">+3以上:</div> <div style="text-align:right;color:#333333;font-weight:700;flex:1">' +  
					holestatisc.worst +'</div></div>' +
					'</div>';
					
					//console.log(str);
	    $('#holestatisccontent').html(str);
		if(holestatisc.bluetee || holestatisc.redtee){
			$('#tee').show();
			$('#bluetee').html(holestatisc.bluetee+'码');
			$('#redtee').html(holestatisc.redtee+'码');
		}
		else{
			$('#tee').hide();
		}
		if(holestatisc.pic){
			$('#divimg').hide();
			$('#imghole').show();
			$('#imghole').attr('src',holestatisc.pic);
		}
		else{
			$('#imghole').hide();
			$('#divimg').show();
		}
	   showinfo();
	   setscoreschat(holestatisc);
}

var mypie="";
function setscoreschat(holestatisc) {
	
    
    var data = [];
    var color=[];
    var lengend=[];
    if (holestatisc) {

      if (holestatisc.holeinone !== '') {
        data.push({
          value: holestatisc.holeinone,
          name: 'HIO',
         
        });
        lengend.push('HIO');
        color.push('#FFCC00');
      }
      if (holestatisc.eagles !== '') {
        data.push({
          value: holestatisc.eagles,
          name: '老鹰',
          color: '#FFCC00'
        });
        lengend.push('老鹰');
        color.push('#FFCC00');
      }
      if (holestatisc.birdie !== '') {
        data.push({
          value: holestatisc.birdie,
          name: '小鸟',
          color: '#DF212F'
        });
        lengend.push('小鸟');
        color.push('#DF212F');
      }
      if (holestatisc.par!== '') {
        data.push({
          value: holestatisc.par,
          name: '帕',
          color: '#53565A'
        });
        lengend.push('帕');
        color.push('#53565A');
      }
      if (holestatisc.bogey !== '') {
        data.push({
          value: holestatisc.bogey,
          name: '博忌',
          color: '#1E90FF'
        });
        lengend.push('博忌');
        color.push('#1E90FF');
      }
      if (holestatisc.dbogey !== '') {
        data.push({
          value: holestatisc.dbogey,
          name: '双博忌',
          color: '#473D98'
        });
        lengend.push('双博忌');
        color.push('#473D98');
      }
      if (holestatisc.worst !== '' ) {
        data.push({
          value: holestatisc.worst,
          name: '三博忌+',
          color: '#333333'
        });
        lengend.push('三博忌+');
        color.push('#333333');
      }

      var option = {
        
        color:color,
        calculable: true,
		title: {
                text: '成绩分布',
                right: 'right',
				top:'0',
				right:50
              },
		grid: {
                top:0,
                left:10,
                right:10,
                bottom:0
              },
		legend: {
			show:false,
        },
        tooltip: {
          show: true,
          formatter: " {b}：{c} "
        },
        series: [{
          label: {
			formatter: "{b}\r\n{c}个",
			position:'inner',
			

          },
          tooltip: {
            show: true,
            trigger: 'item',
            formatter: "{b}:{c}个"
          },
         
          type: 'pie',
			radius: 70,
           
			center:['50%','50%'],
          data: data
        }]
      };
      ////console.log(chart);
	   //console.log(option);
	   mypie="";
	   $('#mychart-pie').show();
	   if(!mypie){
	   
		mypie = echarts.init(document.getElementById('mychart-pie'));
	   }
       mypie.setOption(option);
    
    } else {
      $('#mychart-pie').hide();
    }


  }


 var ranktype = 1;
 var rankindex = 0;
  function changeholestatiscroundranktype(selectrankindex,isrefresh){
	if(selectrankindex==="" || selectrankindex===undefined ){
		selectrankindex = rankindex;
	}
    
    var holestatisc = jsonscoredata.holestatisc;
    //console.log(holestatisc);
    if(!holestatisc && !holestatisc.length<=0)
    {
      return;
    }
    if(rankindex !== selectrankindex){
    
	  rankindex = selectrankindex ;
	  ranktype = 1;
    }
    else{
    
	  
	  rankindex = selectrankindex ;
	  if(!isrefresh){
		ranktype = !ranktype;
		//console.log(ranktype);
	  }
    }
	$('.ranktype').html('');
	$('#t'+rankindex).html(ranktype==1?'▲':'▼');
    var property = "";
    if(rankindex == 0){property = "pos";}
    if(rankindex == 1){property = "sc_ho_id";}
    if(rankindex == 2){property = "sc_par";}
    if(rankindex == 3){property = "agv";}
    if(rankindex == 4){property = "eagles";}
    if(rankindex == 5){property = "birdie";}
    if(rankindex == 6){property = "par";}
    if(rankindex == 7){property = "bogey";}
    if(rankindex == 8){property = "dbogey";}
    if(rankindex == 9){property = "worst";}
    holestatisc.sort(compare(property));
    //console.log(holestatisc);
    jsonscoredata.holestatisc = holestatisc;
	fillholstatic();
	setholestatiscbar();
  }
	
	
	
  
	function compare(property) {
	var that = this;
    return function (a, b) {
      var value1 = a[property];
      var value2 = b[property];
      if(ranktype == 0){
        return value2 - value1;
      }
      else{
        return value1 - value2;
      }
    }
}


	function hideishowinfo(){
		 $('#showinfo').hide();
	}
	
	function showinfo(){
		 $('#showinfo').show();
	}

 
function changeround(rd){
	if(rd<=mt_round){
		rd_id = rd;
		//getdata(rd_id);
	
		window.location = './holestatistics.php?mt_id='+mt_id + '&rd_id='+rd_id;
	}
}


/*  滚动到顶部*/
 $(function () {
   	 $("#go_top").hide();
   })
 
   //scroll() 方法为滚动事件  
   $(window).scroll(function(){
       if ($(window).scrollTop()>100){
          $("#go_top").fadeIn(800);
        }else{
          $("#go_top").fadeOut(800);
        }
    });
 
   /* //返回顶部按钮点击
    $("#go_top").click(function(){
       $('body,html').animate({scrollTop:0},100);
       return false;
    });*/
	
	function gotottop(){
		 $('body,html').animate({scrollTop:0},100);
       return false;
	}

	
	 function scrollPosition(pElementId) {
            var tTop = jQuery("#"+pElementId).offset().top;  //得到控件Top
            var tWindowHeight = jQuery(window).height(); //浏览器可视窗口高度
            var tElementHeight = jQuery("#"+pElementId).height(); //控件高度
            var tScrollTop = tTop - 126; //让控件中心位于可视窗口3分之1处
            jQuery('html, body').animate({  
                    scrollTop: tScrollTop
            }, 1000);  
        }
	
		window.onresize = function(){
			//console.log(myChart);
			if(myChart)myChart.resize();
		    if(mypie)mypie.resize;
		}
	
	
	function setholestatiscbar() {
    var holestatisc = jsonscoredata.holestatisc;
    var holestatisc_totals = jsonscoredata.holestatisc_totals;
   

    if (holestatisc && holestatisc_totals && holestatisc.length>0 ) {
      var holedataX = [];
      var agv = {
        name: '杆数',
        type: 'bar',
        label: {
          normal: {
            show: false,
            position: 'inside'
          }
        },
        data: [],
        itemStyle: {
          emphasis: {
            color: '#db0011'
          }
        }
      };
      var eagles = {
        name: '老鹰',
        type: 'bar',
        label: {
          normal: {
            show: false,
            position: 'inside'
          }
        },
        data: [],
        itemStyle: {
          emphasis: {
            color: '#FFCC00'
          }
        }
      };
      var birdies = {
        name: '小鸟',
        type: 'bar',
        label: {
          normal: {
            show: false,
            position: 'inside'
          }
        },
        data: [],
        itemStyle: {
          emphasis: {
            color: '#DF212F'
          }
        }
      };;
      var pars = {
        name: '帕',
        type: 'bar',
        label: {
          normal: {
            show: false,
            position: 'inside'
          }
        },
        data: [],
        itemStyle: {
          emphasis: {
            color: '#53565A'
          }
        }
      };;
      var boegeys = {
        name: '博忌',
        type: 'bar',
        label: {
          normal: {
            show: false,
            position: 'inside'
          }
        },
        data: [],
        itemStyle: {
          emphasis: {
            color: '#1E90FF'
          }
        }
      };;
      var dboegeys ={
        name: '双博忌',
        type: 'bar',
        label: {
          normal: {
            show: false,
            position: 'inside'
          }
        },
        data: [],
        itemStyle: {
          emphasis: {
            color: '#473D98'
          }
        }
      };;
      var worse = {
        name: '+3及以上',
        type: 'bar',
        label: {
          normal: {
            show: false,
            position: 'inside'
          }
        },
        data: [],
        itemStyle: {
          emphasis: {
            color: '#333333'
          }
        }
      };
      var diff = {
        name: '难度',
        type: 'bar',
        label: {
          normal: {
            show: false,
            position: 'inside'
          }
        },
        data: [],
        itemStyle: {
          emphasis: {
            color: '#000'
          }
        },
	
      };
      var pos = {
        name: '排名',
        type: 'bar',
        label: {
          normal: {
            show: false,
            position: 'inside'
          }
        },
        data: [],
        itemStyle: {
          emphasis: {
            color: '#fcfcfc'
          }
        }
      };
	  
	   var holeno = {
        name: '洞号',
        type: 'bar',
        label: {
          normal: {
            show: false,
            position: 'inside'
          }
        },
        data: [],
        itemStyle: {
          emphasis: {
            color: '#db0011'
          }
        }
      };

      holestatisc.forEach(item=>{
        //console.log(item);
        holedataX.push(item.sc_ho_id);
        eagles.data.push(item.eagles);
        birdies.data.push(item.birdie);
        pars.data.push(item.par);
        boegeys.data.push(item.bogey);
        dboegeys.data.push(item.dbogey);
        worse.data.push(item.worst);
        diff.data.push(item.diff);
        agv.data.push(item.agv);
        pos.data.push(item.pos);
		holeno.data.push(item.diff);
      });
      //难度数值
      //console.log(holedataX);
      var serise = agv;
	  if(rankindex == 0){
		serise = pos;
		
	  }
	  if(rankindex == 1){
		serise = holeno;
	  }
	  if(rankindex == 2){
		serise = diff;
	  }
	  if(rankindex == 3){
		serise = agv;
	  }
	  if(rankindex == 4){
		serise = eagles;
	  }
	  if(rankindex == 5){
		serise = birdies;
	  }
	  if(rankindex == 6){
		serise = pars;
	  }
	  if(rankindex == 7){
		serise = boegeys;
	  }
	  if(rankindex == 8){
		serise = dboegeys;
	  }
	  if(rankindex == 9){
		serise = worse;
	  }
           var option = {
              tooltip: {
                trigger: 'axis',
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                  type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                },
                confine: true
              },
              legend: {
				show: true,
				right: '5%',
				itemWidth: 16,
				itemHeight: 11
			 },
			  title: {
                text: '球洞成绩统计',
                left: 'center',
				top:'1%'
              },
			  
			  	tooltip: {
				show: true,
				trigger: 'axis',
			
				borderColor: '#777',  //外层边框颜色
				borderWidth: 1, //外层边框宽度
				borderRadius: 4, //外层边框圆角
				formatter: function (param) {
                  //console.log(param);
                  var dataIndex = param[0].dataIndex;
                  //console.log(dataIndex);
				
			   
                    var str = '<div style="width:fit-content;"><div style="margin-bottom:6px;background-color:#1067ac;color:#fff;border-radius:4px; display:flex;align-items:center; "><div>' + holedataX[dataIndex] + '号洞' + '</div><div style="text-align:right;color:#fff;font-weight:700;flex:1">R' + rd_id +'</div></div>' +
                    '<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f; margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#db0011"></span></div> <div style="padding:0 16px 0 6px;width:auto">排名:</div> <div style="text-align:right;color:rgb(102,102,102);font-weight:700;flex:1">' + pos.data[dataIndex] +'</div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#db0011"></span></div> <div style="padding:0 16px 0 6px;width:auto">杆数:</div> <div style="text-align:right;color:rgb(102,102,102);font-weight:700;flex:1">' + agv.data[dataIndex] +' </div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#cfcfcf"></span></div> <div style="padding:0 16px 0 6px;width:auto">难度:</div> <div style="text-align:right;color:'+ (diff.data[dataIndex]<0? '#DF212F':'#333333'  )+';font-weight:700;flex:1">' + diff.data[dataIndex] +' </div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#FFCC00"></span></div> <div style="padding:0 16px 0 6px;width:auto">老鹰:</div> <div style="text-align:right;color:#FFCC00;font-weight:700;flex:1">' + eagles.data[dataIndex] +'</div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#DF212F"></span></div> <div style="padding:0 16px 0 6px;width:auto">小鸟:</div> <div style="text-align:right;color:#DF212F;font-weight:700;flex:1">' +  birdies.data[dataIndex] +' </div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#53565A"></span></div> <div style="padding:0 16px 0 6px;width:auto">帕:</div> <div style="text-align:right;color:#53565A;font-weight:700;flex:1">' + pars.data[dataIndex] +'</div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#1E90FF"></span></div> <div style="padding:0 16px 0 6px;width:auto">博忌:</div> <div style="text-align:right;color:#1E90FF;font-weight:700;flex:1">' + boegeys.data[dataIndex] +'</div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#473D98"></span></div> <div style="padding:0 16px 0 6px;width:auto">双博忌:</div> <div style="text-align:right;color:#473D98;font-weight:700;flex:1">' + dboegeys.data[dataIndex] +'</div></div>' +
					'<div style="display:flex;align-items:center;border-bottom:dotted 1px #1f1f1f;margin-bottom:2px"><div><span style="width:10px;height:10px;border-radius: 50%;display:inline-block;background-color:#333333"></span></div> <div style="padding:0 16px 0 6px;width:auto">+3以上:</div> <div style="text-align:right;color:#333333;font-weight:700;flex:1">' +  worse.data[dataIndex] +'</div></div>' +
					'</div>';
					
					//console.log(str);
					return str;
                
                },
				

		},
		
              grid: {
                left: 5,
                right: 5,
                bottom: 10,
                top: 40,
                containLabel: true
              },
              xAxis: [{
                type: 'category',
                axisLine: {
                  lineStyle: {
                    color: '#999'
                  }
                },
                axisLabel: {
                  color: '#666'
                },
               data:holedataX,
              }],
              yAxis: [{
                type: 'value',
                axisTick: {
                  show: false
                },
               
                axisLine: {
                  lineStyle: {
                    color: '#999'
                  }
                },
                axisLabel: {
                  color: '#666'
                },
              
              }],
              series: serise//[pos,agv,diff,eagles,birdies,pars,boegeys,dboegeys,worse],
			  
			  
            };
        myChart="";
		if(!myChart){
		myChart = echarts.init(document.getElementById('mychart-line'));
		}
		//console.log(option);
		myChart.setOption(option);
    } else {
		$('#mychart-line').hide();
    }
  }
	
	
	function gotourl(url){
		window.location = url;
	}
</script>



<style>

    .up{width: 40px;height:40px; position:fixed; left:2vw;bottom:5vw;}
	#content_score {
		min-height: 360px;
		padding: 86px 0 10px;
		width:100%;
	}
	#loadingimg{
		width:40px;
		height:40px;
		position:absolute;
		left:50%;
		top:50%;
		transform: translate(-50%, -50%);
		z-index:999;
	}
	.radius_fillet3 {
		border-radius: 3px;
	}

	.tt_bar {
		height: 30px;
		border-bottom: 1px solid #e3e3e3;
	}
	.score_title2 {
		height: 30px;
		border-bottom: 1px solid #e3e3e3;
		text-indent: 14px;
	}
	.score_back {
		text-align: right;
		padding-right: 14px;
	}
	.bt_back {
		display: inline-block;
		width: 40px;
		height: 18px;
		line-height: 18px;
		cursor: pointer;
		border: 1px solid #363636;
		color: #363636;
		font-size: 12px;
		text-align: center;
	}
	.score_tround {
		height: 30px;
		line-height: 30px;
	}
	.score_tround span {
		color: #363636;
		float: right;
		font-size: 18px;
		height: 26px;
		line-height: 32px;
		margin-right: 15px;
		text-align: center;
		width: 50px;
	}
	.index_news {
		padding: 0 0;
		width:96%;
		margin-left:auto;
		margin-right:auto;
	}

</style>
<!--header-->
<style>

.float_start{display: flex;flex-direction: row;justify-content: flex-start;align-items: center;z-index: 2;}
.float_end{display: flex;flex-direction: row;justify-content: flex-end;align-items: center;z-index: 2;}
.float_between{display: flex;flex-direction: row;justify-content: space-between;align-items: center;z-index: 2;}
.float_around{display: flex;flex-direction: row;justify-content:space-around;align-items: center;z-index: 2;}

	#navi_wait {
		height: 35px;
		background-color: #E3E3E3;
	}

	#navi_wait ul li {
		width: 32%;
		display: inline;
		float: left;
		/*line-height:33px;*/

		line-height: 36px;
		list-style-position: inside;
		border-bottom: 1px solid #A5A5A5;
		text-align: center;
	}

	#navi_wait ul li a {
		color: #767676;
		font-size: 19px;
		letter-spacing: 5px;
	}
	
	.scoringtable{
		border-radius:10px;  border-collapse: collapse;  border-style:hidden;  box-shadow: 0 0 0 1px #d8d8d8; overflow:hidden;
	}
	
	.topar{
		width:90%;
		height:28px;
		border-radius:10px;
		margin:auto auto auto auto;
		color:#fff;
		display:flex;
		justify-content:center;
		align-items:center;
		
	}
	.undereven{
		font-weight:bolder;
		background-color:#B7001F; 
		color:#fff;
	}
	.even{
		font-weight:bolder;
		background-color:#53565A;
		color:#fff;
	}
	.pluseven{
		font-weight:bolder;
		background-color:#00438A;
		color:#fff;
	}
	
	
	.groupcode{
		display:flex;
		flex-dirction:row;
		float:left;
		align-items:center;
		margin-top:10px;
		margin-bottom:5px;
	}
	
	.groupcode div{
		width:50px;
		height:30px;
		display:flex;
		justify-content:center;
		align-items:center;
		color:#000;
		border-radius:10px;
		margin-left:10px;
	}
	
	.full{
		width:100vw;
		height:100vh;
		position:fixed;
		left:0;
		top:0;
		z-index:99999;
	}
	
	.full img{
		width:100%;
		height:100%;
		position:absolute;
		object-fit:cover;
	}
	
	.full .codediv{
		top:40%;
		left:50%;
		position:absolute;
		z-index:100000;
		width:90%;
		transform:translate(-50%,-50%);
		display:flex;
		flex-direction:column;
		justify-content:center;
		align-items:center;
	}
	
	.full .codediv p{
		margin-bottom:20px;
		text-align:center;
		width:100%;
		font-size:20px;
		font-weight:bolder;
	}
	
	.full .codediv .cn{
		margin-bottom:20px;
		text-align:center;
		width:100%;
		font-size:18px;
		
	}
	
	.full .codediv .date{
		margin-bottom:20px;
		text-align:center;
		width:100%;
		font-size:18px;
		color:#cfcfcf;
	}
	
	.full .codediv .codeinputs{
		
		width:90%;
		margin-left:auto;
		margin-right:auto;
		display:flex;
		flex-dirction:row;
		justify-content:center;
		align-items:center;
	}
	.full .codediv .codeinputs input{
		border-radius:10px;
		width:50px;
		height:50px;
		margin-left:auto;
		margin-right:auto;
		border:1px solid #cfcfcf;
		font-size:22px;
		font-weight:bolder;
		text-align:center;
	}
	
	.full .imgsponser{
		top:20%;
		left:50%;
		position:absolute;
		z-index:100000;
		width:100%;
		height:auto;
		transform:translate(-50%,-50%);
	}
	
.stat {display:flex;flex-direction:column; width:100%;}	
.stat .white24{font-size: 16rpx; color:#ffffff;  position: relative; }
.stat .holestatisctitlecontent{width:100%; margin-bottom:20px;}
.stat .red32{color:#1067ac;font-weight:bolder;}

.stat .coninfo{margin:0;width: 100%;margin-bottom: 20px;}
.stat .generic_title{padding-bottom: 12px;} 
.stat .conranking{background: linear-gradient(180deg, #FFFFFF 0%, #F5F5F5 100%);border-radius: 5px 5px 0px 0px;border-bottom: 1px solid #eeeeee;padding:0;width: 100%;font-weight:700;}
.stat .title div{height: 40px;height: 40px;padding:10px 0 0}
.stat .conranking .w20{width: 20%;border-right:1px solid #EEEEEE;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:0 0 0 0 ;}

.stat .conranking .w30{width: 30%;border-left:1px solid #EEEEEE;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:0 0 0 0 ;}
.stat .white{background: #fff;margin:0;border-bottom: 1px solid #eeeeee;border-radius: 0; position: relative;}
.stat .white div{height: 30px;height: 30px;padding:0;}
.stat .white .w50{padding-left: 5%;justify-content: left;width:44%; text-align: left;}
.stat .white .w20{font-style: italic;}
.stat .grey{background: #FBFBFB;}
.stat .average .w30{border-left:0}
.stat .average .w70{width: 70%;}
.stat .average .w70 text{margin-left: 5px;}
.stat .red{background: #db0011;margin:0;border-bottom: 0;border-radius: 0 0 10px 10px;height: 30px;line-height: 30px;}
.stat .red div{height: 30px;line-height:30px;}
.stat .red image{width:8px;height: 12px;margin:0 15px}
.stat .up{color:darkblue;position:relative; left: 0;  bottom: 0;width:auto;height:auto; }
.stat .down{color: #db0011;position:relative;left: 0;  bottom: 0;width:auto;height:auto;}


.stat .white .holestatiscitems{position: absolute;left: -2%; bottom:0;height:12%; border-radius:2%; margin-bottom: auto;margin-top: auto;z-index:-1;}
.stat  .holestatisctitle{background: linear-gradient(180deg, #1067ac  0%, #1067ac 100%); color:#ffffff; height:40px; margin-top:10px; padding-top:0px;padding-bottom: 0px;}
.stat .conranking .w10{width: 8%;border-right:1px solid #EEEEEE;position: relative;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:0 0 0 0 ;}

.stat .eagle{background-color: #FFCC00;  }
.stat .birdie{background-color: #DF212F;  }
.stat .par{background-color: #53565A;  }
.stat .boegey{background-color: #1E90FF;  }
.stat .dboegey{background-color: #473D98;  }
.stat .worts{background-color: 		#333333 ;  }
.stat .white24{font-size:12px; color:#ffffff;  position: relative;height:40px; }
.statiscttabItem{width: 132px; height: 40px;background: #5a5a5a90;color:#fff;border-radius:11px 5px 11px 5px;line-height: 40px;text-align: center; margin-left:5px;}
.selectstatiscttabItem{background-color: #db0011;color:#fff;}
.parb{background-color: #cfcfcf;}
.stat .conranking .w10{width: 8%;border-right:1px solid #EEEEEE;position: relative;}
.stat .rows{background-color: #f6f6f6;}
.stat .conranking .w10 text{z-index: 10000;}
.stat .flexcolounm{display: flex; flex-direction: column;position:relative;}
.stat .flexcolounm text{position: absolute; bottom: 0; left:50%; width: auto; height:25px;font-size: 12px;text-align: center;z-index: 10; }
.stat .conranking .w16{width: 16.8%;border-right:1px solid #EEEEEE;position: relative;display:flex;justify-content:center;align-items:center;}
.stat .bottom{border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;overflow: hidden;border-bottom:none;}
.stat .flexcolounm  .ranktype{position: absolute; bottom: 0; left:50%; transform:translatex(-50%); width: auto; height:15px;font-size: 12px;text-align: center;z-index: 10;}
.empty {height:50px; display:flex; align-items:center; justify-content:center; }


	.showschoollists{width:100%;height:100%;position: fixed;top:0;left:0;z-index: 99;}
	.cover{width:100%;height:100%;z-index: 0; left: 0; top:0; opacity: 0.2; background-color: #333; }

	.colleges .tips ,  .collegessuccess .tips  {font-size:20px; margin-top: 10px;margin-bottom:10px; width:90%;
    margin-left:auto;
    margin-right: auto;display:flex;align-items:center;justify-content:space-between;}
	  .colleges  .grey24n ,  .collegessuccess .grey24n {  width:90%; margin-left:auto;margin-right: auto;margin-bottom:20px;}
	  .colleges .tips img,  .collegessuccess .tips  img{width:16px;height:16px; margin-left:5px; margin-right:5px;margin-bottom:2px;}
	
	
    .collegessuccess {
        width: 100%;
        border-top-left-radius: 20px ;
        border-top-right-radius: 20px ;
        background-color: #fff;
        position: fixed;
        bottom: 0;
        z-index: 99;
        height: auto;
        overflow: hidden;
        
      }
	  
	

    .collegessuccess .smalltips .center {display: flex; flex-direction: row;  justify-content: center; align-items: center;margin-left:auto; margin-right: auto;}

  
     .collegessuccess  .smalltips{font-size:16px; margin-top: 50px;margin-bottom:50px; width:90%;
        margin-left:auto;
        margin-right: auto; display: flex; flex-direction: column;
    }
    .collegessuccess .center {display: flex; flex-direction: row; justify-content: center; align-items: center;margin-left:auto; margin-right: auto;position:relative;}
	
	
	.collegessuccess .center .close{width:30px;height:30px;right:-15px;top:-10px; position:absolute;background-color:#D8222A;color:#fff;font-size:20px;font-weight:700;border-radius:100%; display:flex;justify-content:center;align-items:center;}
	
    .collegessuccess .smalltips text {display: flex; justify-content: center; align-items: center;margin-left:auto; margin-right: auto;text-align: center;}

	.smalltips div{display:flex;justify-content:center;align-items:center;color:#fff;}
	.smalltips .success{background-color:#c32958;width:100px;height:100px;border-radius:100%; }
	.smalltips .warn{background-color:	#BDB76B;width:100px;height:100px;border-radius:100%; }
	.colunmflex{display: flex; flex-direction: colunm; justify-content: center; align-items: center;margin-left:auto; margin-right: auto; margin-bottom:50px;}
	.collegessuccess .center text{margin-right:5px; margin-bottom:50px;}
	.collegessuccess .gray23n {align-items: baseline;}
	
	.tripinfotitle{ width: 80px; height:30px;background: #c32958;border-radius: 5px 3px 5px 3px;line-height: 30px;text-align: center; display:flex;justify-content:center;align-items:center; margin-top:20px; margin-bottom:-22px;}
	
	
.btn{margin: 0 0 10px;background:  linear-gradient(180deg, #1067ac  0%, #1067ac 100%);color: white;border-radius: 10px;line-height: 30px;display:flex;justify-content:center;align-items:center; }
.btn::after {border-radius: 100px;border:0}
.white40{font-size:26px;}

.white40{font-size:26px;}
.prev{background:  linear-gradient(180deg, red  0%, #D8222A 100%);color: white;font-size:18px;}
.next{background:  linear-gradient(180deg, orange  0%, #FF6B4C 100%);color: white;font-size:18px;}
		.holedisplatcontent{width:90%;margin-left:auto;margin-right:auto;display:flex;flex-direction:row;margin-top:10px;margin-bottom:20px;}
		.holedisplatcontent .imghole{width:50%; height:auto; border-radius:10px; border:1px dotted #cfcfcf; font-size:20px; display:flex;align-items:center;justify-content:center;color:#cfcfcf; position:relative;}
		.holedisplatcontent .imghole img{width:100%;}
		.holedisplatcontentright{width:46%; height:auto; margin-left:auto; margin-right:0px;font-size:18px;display:flex;justify-content:flex-end;}
		.tee{width:100px;padding-left:10px;padding-right:10px;height:30px; position:absolute;left:50%;top:20px; transform:translatex(-50%); display:flex;flex-direction:column; justify-content:flex-start; align-items:center; font-size:16px; }
		.tee .teedetail{ width:100%; border-radius:3px;margin-bottom:10px; display:flex;flex-direction:row; padding-left:10px;padding-right:10px;}
		
		.menulists{display:flex;flex-direction:row; justify-content:center;align-items:center;margin-top:5px;margin-bottom:5px;}
	.menulists .menu{display:flex;flex-direction:column; justify-content:center;align-items:center;width:70px; height:70px; background: linear-gradient(180deg, #1067ac  0%, #1067ac 100%); color:#ffffff;border-radius:10px;margin-left:auto;margin-right:auto;}
	.menulists .menu img{ width:40px;height:40px; margin-top:5px; }
	.menulists .menu text{ display:flex; justify-content:center; font-size:12px; font-weight:700; color:#fff; margin-top:5px;margin-bottom:5px; }
		
</style></head>

<body id="body">
	<div id="fullloading" class="full"  style="display:none;"onclick="closefullpre()">
		<img  id="imgfullloading" src="./images/pre.png"/>
		<img  class="imgsponser" src="./images/1.png"/>
		<div class="codediv">
			<P><?php echo str_replace("-","<br/>",$match_cn_name);?></P>
			<P class="cn"></P>
			<P class="date"><?php echo $mt_start_date.'~'.$mt_end_date?></P>
			<!--
			<div class="codeinputs">
			<input type="tel" maxlength="1" min="0" max="9"  pattern="[0-9]" value=""  id="code0" oninput="inputcode(0)"/>
			<input type="tel" maxlength="1" min="0" max="9"  pattern="[0-9]" value=""  id="code1"  oninput="inputcode(1)"/>
			<input type="tel" maxlength="1" min="0" max="9"  pattern="[0-9]" value=""  id="code2" oninput="inputcode(2)" />
			<input type="tel" maxlength="1" min="0" max="9"  pattern="[0-9]" value=""  id="code3"   oninput="inputcode(3)"/>
			</div>-->
		</div>
	</div>
	<div id="sta">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<tbody>
				<tr>
					<td style="text-align:center;"><img src="./images/3.png" style="width:350px;height:80px" /></td>
				</tr>
			</tbody>
		</table>
	</div>

    <img  id="loadingimg" src="./images/icon_load.gif" style="display:none;"/>
	<div id="content_score" style="">
		<div class="pullrefresh" style="display:none;"></div>

		<div class="clear_h10" style="clear:both; height:10px;"></div>
		<marquee style="margin-top:10px;display:none;" width="100%" align="absmiddle" height="30"><font style="color:#B7001F;">由于天黑原因第二轮比赛暂停，比赛将于第二天周四恢复，请各位球员于<b> 07:30 </b>前在出发广场集合，进行开球前准备工作。</font></marquee>
		<div  class="index_news">
			<table class="altrowstable scoringtable">
				<tr>
					
								<td style="border:none; vertical-align:middle;" >
								<div>
								<font style="font-weight:bolder;font-size:17px;"><?php echo str_replace('-','<br/>',$match_cn_name);?></font>
								
								</div>
							
								</td>
								</tr>
								<tr>
								<td style="border:none; vertical-align:middle;">
									
									
								<div style="display:flex;flex-direction:row;justify-content:center;position:relative;">
								<div style="text-align:center;color:#333;font-weight:700;font-size:16px;"> 球洞统计 </div>
							
                               <div style="display:flex;flex-direction:row;justify-content:center;position:absolute;right:0;top:0;">
									<?php if($mt_sts=='N'){
									echo '<font style="float:right;color:#B7001F; font-weight:bolder;font-size:15px;">比赛未开始</font>';
								}		
								else if($mt_sts=='O')	{
									echo '<font style="float:right;color:#00438A;font-weight:bolder;font-size:15px;">'.$roundtext[$mt_round].'进行中</font>';
								}	
								else{
									echo '<font style="float:right;color:#00438A;font-weight:bolder;font-size:15px;">比赛已结束</font>';
								}								?>
								 </div>									
							   </div>									
										
							</td>
													
				</tr>
			</table>
			
			<?php menu($mt_id,3,$static); ?>
			

			<?php
			 if($maxRound >1) 
			 {  
		        echo ' <div class="score_round" style="margin-left:auto;margin-right:auto;width:100%;justify-content: center;display:flex;float:left; align-items:center;">';
				
				for($i=1;$i<=$maxRound;$i++){
                	echo '<span class="jq_rclk" '.(($i==$rd_id)?'style="float:left;border-radius:10px;background-color:#00438A;color:#fff;width:90px;margin-left:auto;margin-right:auto;"':(($i<=$mt_round)?'style="float:left;border-radius:10px;background-color:#fff;color:#00438A;width:90px;margin-left:auto;margin-right:auto;"':'style="float:left;border-radius:10px;background-color:#53565A;color:#fff;width:90px;margin-left:auto;margin-right:auto;"')).' onclick="changeround('.$i.')">R'.$i.' '.$roundtext[$i].'</span>';
                }	
				
				
			   echo '</div>';
			 }
			?>
			<div id="scoringlists" class="stat" >
			
			<div class="holestatisctitlecontent"   >

			<div class="float_between conranking form holestatisctitle">
            <div class="white24 poppin piccenter w10 flexcolounm" onclick="changeholestatiscroundranktype(0)">
			     <p>#</p>
				<text class="ranktype" id="t0"></text>
            </div>
            <div class="white24 poppin piccenter w10 flexcolounm" onclick="changeholestatiscroundranktype(1)"> 
				<p>洞</p>
				<text class="ranktype"  id="t1"></text>
            </div>
            <div class="white24 poppin piccenter w10 flexcolounm" onclick="changeholestatiscroundranktype(2)">
				<p>PAR</p>
				<text class="ranktype"  id="t2"></text>
            </div>
            <div class="white24 poppin piccenter w20 flexcolounm" onclick="changeholestatiscroundranktype(3)">
				<p>杆数</p>
				<text class="ranktype"  id="t3"></text>
            </div>
            <div class="white24 poppin piccenter w10 flexcolounm" onclick="changeholestatiscroundranktype(4)">
				<p>鹰</p>
				<text  class="ranktype" id="t4"></text>
            </div>
            <div class="white24 poppin piccenter w10 flexcolounm" onclick="changeholestatiscroundranktype(5)">
				<p>鸟</p>
				<text  class="ranktype" id="t5"></text>
            </div>
            <div class="white24 poppin piccenter w10 flexcolounm" onclick="changeholestatiscroundranktype(6)">
				<p>帕</p>
				<text  class="ranktype" id="t6"></text>
            </div>
            <div class="white24 poppin piccenter w10 flexcolounm" onclick="changeholestatiscroundranktype(7)">
				<p>+1</p>
				<text  class="ranktype" id="t7"></text>
            </div>
            <div class="white24 poppin piccenter w10 flexcolounm" onclick="changeholestatiscroundranktype(8)">
				<p>+2</p>
				<text  class="ranktype" id="t8"></text>
            </div>
            <div class="white24 poppin piccenter w10 flexcolounm" onclick="changeholestatiscroundranktype(9)">
				<p>3+</p>
				<text  class="ranktype" id="t9"></text>
				
            </div>
          </div>
			<div id="divholestatisc"> </div>

         
        
		<div id="mychart-line" style="width:100%;height:300px;background-color:#fff;border-radius:10px; margin-top:10px;"></div>

       

        
			


		
			</div>
		</div>
	

	</div>
	<div style="text-align:centre;display:none;justify-content: center;">
			<img src="./images/ad.jpg" style="width:100%;height:100%"></div>
	</div>
	<img src="images/up.png" class="up" id="go_top" onclick="gotottop();">
 <div class="showschoollists"  id="showinfo" style="display:none;">
   <div class="cover" onclick="hideishowinfo()"></div>
  <div class="showconet collegessuccess center"  >
	
	 <div class="tips center" ><?php echo str_replace('-','<br/>',$match_cn_name); ?>  <span class="close" onclick="hideishowinfo()" >X</span> </div>
	  <div class="tips center" id="infotitle"></div>
		
	  <div class="holedisplatcontent">
		<div  class="imghole" >
			<div  id="divimg"  >
			暂无</br>
			球道图
			</div>
			<img id="imghole" class="imghole" style="display:none;"/>
			
			<div id ="tee" class="tee" style="display:none;">
				<div class="teedetail" style="background-color:#1067ac;color:#fff;"><text>男子:</text> <div style="text-align:right;color:#fff;font-weight:700;flex:1" id="bluetee"></div></div>
				<div  class="teedetail" style="background-color:#DF212F;color:#fff;"><text>女子:</text> <div style="text-align:right;color:#fff;font-weight:700;flex:1" id="redtee"></div></div>
			</div>
		</div>
		
		
		<div id="holestatisccontent" class="holedisplatcontentright">
			
		</div>
	    
	  </div>
	 <div id="mychart-pie"  style="width:100%;height:150px;background-color:#fff;border-radius:10px; margin-top:10px;display:none;"></div>
    <div class="pangmen center gray23n" >
		<span class="btn white40 prev" onclick="prevhole()"  style="width:25%;height:35px;margin-left:auto;margin-right:auto;">上一洞</span>
	   
		<span class="btn white40 next"  onclick="nexthole()"  style="width:25%;height:35px;margin-left:auto;margin-right:auto;">下一洞</span>
	</div>
</div>

</div>

<div style="text-align:centre;justify-content: center;">
			<img src="./images/ad.jpg" style="width:100%;height:100%"></div>
	</div>

<div id="bottom" style="background-color:#fff;text-align:centre;display:flex;justify-content: center;">
	<div id="bootom-top">
        <span style="width:100%;text-align:center">技术支持  @斯科云科技</span>
        <script type="text/javascript">document.write(unescape("%3Cspan id='cnzz_stat_icon_1279000992'%3E%3C/span%3E%3Cscript src='https://s4.cnzz.com/z_stat.php%3Fid%3D1279000992%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));</script>
		
	</div>
</div>
</body>
<script>

	function inputcode(index){
		var str = $('#code'+index).val();
		var code = "";
		for(var codeindex = 0 ;codeindex<=3;codeindex++){
			code +=  $('#code'+codeindex).val().toString();
		}
		if(code ==mt_id ) //通过验证码{
		{
			//console.log("首次被加载");
			
			for(var codeindex = 0 ;codeindex<=3;codeindex++){
				$('#code'+codeindex).blur();
			}

			document.title = '<?php echo $match_cn_name?>-成绩直播-Scoring By 斯科云科技';
			//sessionStorage.setItem("isReload", true);
		
		}
		else{
			if(code.length ==4){
				for(var codeindex = 0 ;codeindex<=3;codeindex++){
				  $('#code'+codeindex).css('border','1px solid red');
				  
				}
				
			}
			else{
				for(var codeindex = 0 ;codeindex<=3;codeindex++){
				  $('#code'+codeindex).css('border','1px solid #cfcfcf');
				}
			}
			if(str!=''){
				var next = index+1;
				if(index == 3){
					next = 0;
				}
		
				$('#code'+next).focus();
			}
		}
	}
	//proloading();

	var pretime = "";
	function proloading(){
		
		$('#code0').focus();
	    
		let storage = new Storage();
		let value = storage.getItem('ischeked');
		if(value == 1){
			//console.log("页面直接进入");
			
			$('#fullloading').hide();
			//$(this).fadeOut("fullloading");
			//console.log($('#fullloading'));
		}else{
			
			//$('#fullloading').fadeIn();
			let storage = new Storage();
			storage.setItem({
				name:"ischeked",
				value:1,
				expires:1*24*3600*1000,   //一周 默认
                startTime:new Date().getTime()//记录何时将值存入缓存，毫秒级
			})
			pretime = setTimeout(function(){
				$('#fullloading').fadeOut(2000);
			
			},2000);
			
		}
	}
	
	
	function closefullpre(){
		//console.log($('#fullloading'));
		$('#fullloading').fadeOut(1000);
		
		clearTimeout(pretime);
	}
</script>

</html>